# -*- makefile -*-

all:

include Make.vars

DIRS = $(sort $(addprefix build/,$(KERNEL_SUBDIRS) $(TEST_SUBDIRS) lib/user))

all grade check: $(DIRS) build/Makefile
	cd build && $(MAKE) $@
$(DIRS):
	mkdir -p $@
build/Makefile: ../Makefile.build
	cp $< $@

build/%: $(DIRS) build/Makefile
	cd build && $(MAKE) $*

image: build/kernel.img

qemu: build/qemu

qemu-nox: build/qemu-nox

clean:
	rm -rf build
